using System;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using System.Data.SqlServerCe;
using System.Collections;
using System.Security.Cryptography;


namespace VoteMeDefine
{
    public class VariableDefine
    {
        public static string picturePath;
        public static string appPath;
        public static string user;
        public static string iniPath;
        public static string groups;
        public static string rates;
        public static string connString;
        public static SqlCeConnection meConn;
        public static SqlCeCommand meCmd;
        public static ResultSetOptions meRSOptions = ResultSetOptions.Scrollable |
                                       ResultSetOptions.Sensitive |
                                       ResultSetOptions.Updatable;

        public static ArrayList alPicFileName;
        public static string dateFormate = "yyyy-MM-dd HH:mm:ss";
        public static string strShowingPicFullName;
        public static string getFileMD5(string strFullFileName)
        {
            try
            {
                FileStream fsGet = new FileStream(strFullFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
                MD5CryptoServiceProvider md5Get = new MD5CryptoServiceProvider();
                byte[] hash_byte = md5Get.ComputeHash(fsGet);
                //get_md5.ComputeHash(get_file);
                string result = System.BitConverter.ToString(hash_byte);
                result = result.Replace("-", "");
                return result;
            }
            catch (Exception e)
            {
                return e.ToString();
            }
        }

    }

}